<template>
  <!-- 雷达图组件 -->
  <div ref="myDiv" class="myDiv"></div>
</template>

<script>
export default {
  mounted () {
    this.initChart()
  },

  methods: {
    initChart () {
      const myChart = this.echarts.init(this.$refs.myDiv)
      const option = {
        radar: {
          name: {
            textStyle: {
              color: 'yellow',
              backgroundColor: '#999',
              borderRadius: 3,
              padding: [3, 5]
            }
          },

          // shape: 'circle',
          indicator: [
            { name: '工作效率', max: 100 },
            { name: '考勤', max: 100 },
            { name: '积极性', max: 100 },
            { name: '帮助同事', max: 100 },
            { name: '自主学习', max: 100 },
            { name: '正确率', max: 100 }
          ]
        },
        series: [{
          type: 'radar',
          // areaStyle: {normal: {}},
          data: [
            {
              value: [80, 50, 100, 60, 100, 70],
              name: '张三'
            },
            {
              value: [50, 90, 50, 80, 50, 70],
              name: '李四'
            }
          ]
        }]
      }
      myChart.setOption(option)
    }

  }
}
</script>

<style lang="scss">
.myDiv {
  width: 100%;
  height: 300px;
  text-align: center;
}
</style>
